import React from 'react'

const Fn1 = (props) => {
  console.log('函数组件接受父组件传值', props)
  const reMoney = () => {
    props.changeMoney(props.id, 0.1)
  }
  return (
    <div
      style={{
        marginBottom: 10,
        height: 150,
        width: 400,
        border: '2px solid skyblue',
      }}>
      <h2>标题:{props.title}</h2>
      <h3>价格:{props.price.toFixed(2)}</h3>
      <h3>{props.desc}</h3>
      <button onClick={reMoney}>砍价</button>
    </div>
  )
}
export default Fn1
